package jpa.entitys.promis.common;

import java.io.Serializable;

import javax.persistence.*;

/**
 * The primary key class for the CONTRACT_UNIT_DETAIL_PERIODS database table.
 * 
 */
@Embeddable
public class ContractUnitDetailPeriodPK implements Serializable {
	//default serial version id, required for serializable classes.
	private static final long serialVersionUID = 1L;

	@Column(unique=true, nullable=false, length=2)
	private String company;
	
	@Override public String toString() { return org.apache.commons.lang.builder.ToStringBuilder.reflectionToString(this);}

	@Column(name="BILLING_CODE", unique=true, nullable=false, length=30)
	private String billingCode;

	@Column(name="CONTRACT_SEQ", unique=true, nullable=false, precision=6)
	private long contractSeq;

	@Column(name="SEQ_NO", unique=true, nullable=false, precision=22)
	private long seqNo;

	@Column(unique=true, nullable=false, length=30)
	private String project;

	@Column(name="PROPERTY_TYPE_CODE", unique=true, nullable=false, length=30)
	private String propertyTypeCode;

	@Column(name="BUILDING_PHASE_CODE", unique=true, nullable=false, length=30)
	private String buildingPhaseCode;

	@Column(name="TYPE_OF_CONTRACT", unique=true, nullable=false, length=2)
	private String typeOfContract;

	@Column(name="CONTRACT_SERIES", unique=true, nullable=false, length=4)
	private String contractSeries;

	@Column(name="CONTRACT_NO", unique=true, nullable=false, precision=6)
	private long contractNo;

	@Column(name="REVISION_NUMBER", unique=true, nullable=false, precision=3)
	private long revisionNumber;

	@Column(name="UNIT_NUMBER", unique=true, nullable=false, length=30)
	private String unitNumber;

    public ContractUnitDetailPeriodPK() {
    }
	public String getCompany() {
		return this.company;
	}
	public void setCompany(String company) {
		this.company = company;
	}
	public String getBillingCode() {
		return this.billingCode;
	}
	public void setBillingCode(String billingCode) {
		this.billingCode = billingCode;
	}
	public long getContractSeq() {
		return this.contractSeq;
	}
	public void setContractSeq(long contractSeq) {
		this.contractSeq = contractSeq;
	}
	public long getSeqNo() {
		return this.seqNo;
	}
	public void setSeqNo(long seqNo) {
		this.seqNo = seqNo;
	}
	public String getProject() {
		return this.project;
	}
	public void setProject(String project) {
		this.project = project;
	}
	public String getPropertyTypeCode() {
		return this.propertyTypeCode;
	}
	public void setPropertyTypeCode(String propertyTypeCode) {
		this.propertyTypeCode = propertyTypeCode;
	}
	public String getBuildingPhaseCode() {
		return this.buildingPhaseCode;
	}
	public void setBuildingPhaseCode(String buildingPhaseCode) {
		this.buildingPhaseCode = buildingPhaseCode;
	}
	public String getTypeOfContract() {
		return this.typeOfContract;
	}
	public void setTypeOfContract(String typeOfContract) {
		this.typeOfContract = typeOfContract;
	}
	public String getContractSeries() {
		return this.contractSeries;
	}
	public void setContractSeries(String contractSeries) {
		this.contractSeries = contractSeries;
	}
	public long getContractNo() {
		return this.contractNo;
	}
	public void setContractNo(long contractNo) {
		this.contractNo = contractNo;
	}
	public long getRevisionNumber() {
		return this.revisionNumber;
	}
	public void setRevisionNumber(long revisionNumber) {
		this.revisionNumber = revisionNumber;
	}
	public String getUnitNumber() {
		return this.unitNumber;
	}
	public void setUnitNumber(String unitNumber) {
		this.unitNumber = unitNumber;
	}

	public boolean equals(Object other) {
		if (this == other) {
			return true;
		}
		if (!(other instanceof ContractUnitDetailPeriodPK)) {
			return false;
		}
		ContractUnitDetailPeriodPK castOther = (ContractUnitDetailPeriodPK)other;
		return 
			this.company.equals(castOther.company)
			&& this.billingCode.equals(castOther.billingCode)
			&& (this.contractSeq == castOther.contractSeq)
			&& (this.seqNo == castOther.seqNo)
			&& this.project.equals(castOther.project)
			&& this.propertyTypeCode.equals(castOther.propertyTypeCode)
			&& this.buildingPhaseCode.equals(castOther.buildingPhaseCode)
			&& this.typeOfContract.equals(castOther.typeOfContract)
			&& this.contractSeries.equals(castOther.contractSeries)
			&& (this.contractNo == castOther.contractNo)
			&& (this.revisionNumber == castOther.revisionNumber)
			&& this.unitNumber.equals(castOther.unitNumber);

    }
    
	public int hashCode() {
		final int prime = 31;
		int hash = 17;
		hash = hash * prime + this.company.hashCode();
		hash = hash * prime + this.billingCode.hashCode();
		hash = hash * prime + ((int) (this.contractSeq ^ (this.contractSeq >>> 32)));
		hash = hash * prime + ((int) (this.seqNo ^ (this.seqNo >>> 32)));
		hash = hash * prime + this.project.hashCode();
		hash = hash * prime + this.propertyTypeCode.hashCode();
		hash = hash * prime + this.buildingPhaseCode.hashCode();
		hash = hash * prime + this.typeOfContract.hashCode();
		hash = hash * prime + this.contractSeries.hashCode();
		hash = hash * prime + ((int) (this.contractNo ^ (this.contractNo >>> 32)));
		hash = hash * prime + ((int) (this.revisionNumber ^ (this.revisionNumber >>> 32)));
		hash = hash * prime + this.unitNumber.hashCode();
		
		return hash;
    }
}